<?php

namespace Happy\CommandsService\Database\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CommandsModel extends Model
{
    protected $table = 'commands';

    public $timestamps = false;

    protected $primaryKey = 'id';

    protected $fillable = ['time', 'command', 'response_id', 'session_id'];

    public function response(): BelongsTo
    {
        return $this->belongsTo(ResponseModel::class, 'response_id', 'id');
    }

    public function session()
    {
        return $this->belongsTo(SessionsModel::class, 'session_id', 'id');
    }
}
